﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Folder
{
    public partial class Form2 : Form
    {
        
       
        private Boolean mousing = false;
        private int starX;
        private int starY;
        private Point mouse_offset;
        public Form2()
        {
            InitializeComponent();
        }

        
        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
           // mouse_offset = new Point(-e.X, -e.Y);
            mousing = true;

            starX = e.X;
            starY = e.Y;
            
        }

        private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Point mousePos = Control.MousePosition;
                mousePos.Offset(mouse_offset.X, mouse_offset.Y);
                Location = mousePos;
            }
           
            
        }
        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
           //System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new System.Drawing.Drawing2D.GraphicsPath();
           //myGraphicsPath.AddRectangle((new Rectangle(130, 130, 80, 80)));
           //pictureBox1.Size = new System.Drawing.Size(100, 100);
           //pictureBox1.Region = new Region(myGraphicsPath);

        }


        private void pictureBox2_MouseMove(object sender, MouseEventArgs e)
        {
            //if (e.Button == MouseButtons.Left)
            //{
            //    Point mousePos = Control.MousePosition;
            //    mousePos.Offset(mouse_offset.X, mouse_offset.Y);
            //    Location = mousePos;
            //}
         
        }

        private void pictureBox2_MouseDown(object sender, MouseEventArgs e)
        {
            mouse_offset = new Point(-e.X, -e.Y);
      
        }

        private void pictureBox2_Paint(object sender, PaintEventArgs e)
        {
            //System.Drawing.Drawing2D.GraphicsPath myGraphicsPath = new System.Drawing.Drawing2D.GraphicsPath();
            //myGraphicsPath.AddRectangle((new Rectangle(20, 20, 80, 80)));
            //pictureBox2.Size = new System.Drawing.Size(100, 100);
            //pictureBox2.Region = new Region(myGraphicsPath);

        }

        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            mousing = false;
        }

        private void pictureBox2_MouseUp(object sender, MouseEventArgs e)
        {
         
        }

       

    }
}
